package com.haina.shop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.haina.shop.domain.UserAddr;
import com.haina.shop.service.UserAddrService;
import com.haina.shop.mapper.UserAddrMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author 48077
* @description 针对表【tz_user_addr(用户配送地址)】的数据库操作Service实现
* @createDate 2024-07-31 18:34:30
*/
@Service
public class UserAddrServiceImpl extends ServiceImpl<UserAddrMapper, UserAddr>
    implements UserAddrService{

    @Resource
    private UserAddrMapper userAddrMapper;

    @Override
    public int insert(UserAddr addrParam) {
        int i = userAddrMapper.insert(addrParam);
        return i;
    }

    @Override
    public int updComAddr(int addrId) {

        userAddrMapper.updCommonAddrAll();
        int i = userAddrMapper.updCommonAddr(addrId);
        return 0;
    }

    @Override
    public UserAddr selAddrId(int addrId) {
        UserAddr userAddr = userAddrMapper.selByAddrId(addrId);
        return userAddr;
    }

    @Override
    public int deleteAddr(int addrId) {
        int i = userAddrMapper.deleteAddr(addrId);
        return i;
    }

    @Override
    public int updAddr(UserAddr userAddr) {
        int i = userAddrMapper.updateAddr(userAddr);
        return i;
    }
}




